<p id="notice"><%= notice %></p>
<%= form_tag account_show_path, :method => :get do %>
  <p>
    <%= text_field_tag :search, params[:search] %>
    <%= submit_tag "Search", :name => nil %>
  </p>
<% end %>

<h1>Listing books</h1>
<table>
  <tr>
    <th>Name</th>
    <th>Category</th>
    <th>Description</th>
    <th>Numbers</th>
    <th>Numbers Borrowed</th>  
    <th></th> 
  </tr>
<% @books.each do |book| %>
  <tr>
    <td><%= book.name %></td>    
    <td><%= book.category.name %></td>    
    <td><%= book.description %></td>
    <td><%= book.numbers %></td>
    <td><%= book.numbers_to_borrow %></td>   
   <td> <%= button_to 'Borrow', account_create_path(:book_id => book), :method => :post%></td>   
  </tr>
<% end %>
</table>
<br />
<%= link_to 'Back to Account page', admin_path %>
